﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcBHXH.Common;

namespace MvcBHXH.Models
{
    class MucBHModel
    {
        private DataClassesBHYTTNDataContext context;
        public MucBHModel() 
        {
            context = Util.CreateInstance().DataContext();
        }

        public List<MucBHModel> GetMucBHModel()
        {
            var MucBH = from fc in context.tbl_MucBHs
                        select new 
                        {
                            fc.Ma_MucBH,
                            fc.Ten_MucBH,
                            fc.GhiChu,
                        };
            List<MucBHModel> listMucBHModel = new List<MucBHModel>();
            MucBHModel objMucBH;
            foreach (var item in MucBH)
            {
                objMucBH = new MucBHModel();
                objMucBH.MaMucBH = item.Ma_MucBH;
                objMucBH.TenMucBH = item.Ten_MucBH;
                objMucBH.GhiChu = item.GhiChu;
                listMucBHModel.Add(objMucBH);
            }
            return listMucBHModel;
        }

        private string maMucBH;

        public string MaMucBH
        {
            get { return maMucBH; }
            set { maMucBH = value; }
        }
        private string tenMucBH;

        public string TenMucBH
        {
            get { return tenMucBH; }
            set { tenMucBH = value; }
        }
        private string ghiChu;

        public string GhiChu
        {
            get { return ghiChu; }
            set { ghiChu = value; }
        }


    }
}
